﻿@model MeetingNewsInfoModel
@{
	Layout = null;
}
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="keywords" content="@Model.Keywords">
	<meta name="description" content="@Model.Description">
	<title>@Model.NewsTitle@ConstValues.strDash@Model.ConferenceName</title>
	<meta name="description" content="@Model.MainText">
	<link rel="stylesheet" href="~/Content/cstyle.css">
	<script src="~/Scripts/tempjs/focus.js" type="text/javascript"></script>
	<script src="~/Scripts/background.js" type="text/javascript"></script>
	<script src="~/Scripts/tempjs/buttonLite.js" type="text/javascript"></script>
	<script src="~/Scripts/tempjs/bshareC0.js" type="text/javascript"></script>
	<script>
		$(function () {
			var language = "";
			@if (Model.IsInternational == true) {
				<text>
				language = "@ConstValues.Language.En";
				</text>
			} else {
				<text>
				language = "@ConstValues.Language.Cn";
				</text>
			}

			@if (Request.Cookies["_culture"] == null) {
				<text>
				$("#hidCulture").val(language);
				$("#frmCulture").submit();
				</text>
			} else {
				<text>
				if (language != "@Request.Cookies["_culture"].Value") {
					$("#hidCulture").val(language);
					$("#frmCulture").submit();
				}
				</text>
			}

			var id = "@Model.ConferenceId";

			//Top
			var curl = "@Url.Action(nameof(UtilityController.GetConferenceData), nameof(UtilityController).GetControllerName())" + "/" + id;
			$.get(curl, null, function (data, textStatus, jqXHR) {
				if (data.result == "@ConstValues.AjaxSuccessResult") {
					if ("@Model.IsShowCountdown" == "True") {
						$("#m-time").html("")
						if (!data.data.allowEntry) {
							if (data.data.betweenDays < 0) {
								$("#m-time").append("<p><span>@Resources.ConferenceIsFinish</span></p>")
							} else if (data.data.betweenDays >= 0) {
								var topMessage = "@Resources.FromNowToStartday";
								if ("@Model.IsInternational" == "True") {
									if (data.data.betweenDays < 10) {
										topMessage = topMessage.replace(/\{0\}/g, '<span style="position: absolute;left: -51px;top: 7px;">' + data.data.betweenDays + '</span>');
									} else if (10 <= data.data.betweenDays < 100) {
										topMessage = topMessage.replace(/\{0\}/g, '<span style="position: absolute;left: -60px;top: 7px;">' + data.data.betweenDays + '</span>');
									} else {
										topMessage = topMessage.replace(/\{0\}/g, '<span style="position: absolute;left: -71px;top: 7px;">' + data.data.betweenDays + '</span>');
									}
									$("#m-time").append('<p style="text-align: left;width: 200px;position: relative;left: 67px;line-height: 18px; top: 4px; font-size:16px">' + topMessage + '</p>')
								} else {
									topMessage = topMessage.replace(/\{0\}/g, "<span>" + data.data.betweenDays + "</span>");
									$("#m-time").append("<p>" + topMessage + "</p>")
								}
							}
						} else {
							$("#m-time").append("<p><span>@Resources.MsgConferenceIsOperating</span></p>")
						}
					} else {
						$("#m-time").css("display", "none");
					}

					if (!data.data.allowRegister) {
						$("#m-rButton").css("background", "#d4d4d4")
						$("#m-rButton").css("cursor", "default")
						$("#m-rButton").attr("diabled", true)
					}

					if (!data.data.allowContribute) {
						$("#m-cButton").css("background", "#d4d4d4")
						$("#m-cButton").css("cursor", "default")
						$("#m-cButton").attr("diabled", true)
					}
				}
			});

			var menuFontColor = "#ffffff";
			@if (!string.IsNullOrEmpty(Model.FontColorForMenu)) {
				<text>
				menuFontColor = "@Model.FontColorForMenu"
				</text>
			}

			//Menu
			$("#m-menu").html("");
			var m_url = "@Url.Action(nameof(UtilityController.GetLevelOneMenu),
				nameof(UtilityController).GetControllerName())" + "/" + id;
			$.get(m_url, null, function (data, textStatus, jqXHR) {
				if (data.length > 0) {
					var len = 0
					for (var index = 0; index < data.length; index++) {
						var mId = data[index].id
						var html = ""
						if (data[index].link != "") {
							html = '<li class="l1" id="li_' + mId + '"><a id="menu_' + mId + '" href="' + data[index].link + '" target="_blank" style="color:' + menuFontColor + '">' + data[index].menuName + '</a>'
								+ '<div class="hid"><ul id="menu2' + mId + '"></ul></div></li>'
						} else {
							html = '<li class="l1" id="li_' + mId + '"><span id="menu_' + mId + '" style="color:' + menuFontColor + '">' + data[index].menuName + '</span>'
								+ '<div class="hid"><ul id="menu2' + mId + '"></ul></div></li>'
						}
						$("#m-menu").append(html)
						len += $("#li_" + mId).innerWidth();

						$("#menu2" + mId).html("")
						var m2_url = "@Url.Action(nameof(UtilityController.GetLevelTwoMenu),
							nameof(UtilityController).GetControllerName())?id=" + "@Model.ConferenceId" + "&menuId=" + mId;
						$.get(m2_url, null, function (tdata, textStatus, jqXHR) {
							if (tdata.length > 0) {
								for (var subindex = 0; subindex < tdata.length; subindex++) {
									var mhtml = ""
									if (tdata[subindex].link != "") {
										mhtml = '<li class="l2"><a id="submenu_' + subindex + '" href="' + tdata[subindex].link + '" target="_blank" style="color:' + menuFontColor + '">' + tdata[subindex].menuName + '</a></li>'
									} else {
										mhtml = '<li class="l2"><span id="submenu_' + subindex + '" style="color:' + menuFontColor + '">' + tdata[subindex].menuName + '</span></li>'
									}
									$("#menu2" + tdata[subindex].menuId).append(mhtml)
								}
							}
						});
					}

					background.setOnResize();

					@if (!string.IsNullOrEmpty(Model.ColorForMenu)) {
						<text>
						background.setBackgroundAndOpacity($(".top"), "@Model.ColorForMenu", 1 - Number("@Model.OpacityOfMenu"));
						$(".l1").hover(function () {
							background.setBackgroundAndOpacity(this, "@Model.ColorForMenu", 0.9 - Number("@Model.OpacityOfMenu"));
							background.setBackgroundAndOpacity($(".hid"), "@Model.ColorForMenu", 1 - Number("@Model.OpacityOfMenu") * (0.1 + Number("@Model.OpacityOfMenu")));

							$(".l2 a").hover(function () {
								jQuery(this).css({ "text-decoration": "underline" });
							}, function () {
								jQuery(this).css({ "text-decoration": "none" });
							});
						}, function () {
							background.setBackgroundAndOpacity($(this), "@Model.ColorForMenu", 0);
						});
						</text>
					} else {
						<text>
						background.setBackgroundAndOpacity($(".top"), "#4c4948", 1);
						$(".l1").hover(function () {
							background.setBackgroundAndOpacity(this, "#6c6b6a", 1);
							background.setBackgroundAndOpacity($(".hid"), "#6c6b6a", 1);
							$(".l2 a").hover(function () {
								jQuery(this).css({ "text-decoration": "underline" });
							}, function () {
								jQuery(this).css({ "text-decoration": "none" });
							});
						}, function () {
							background.setBackgroundAndOpacity(this, "#4c4948", 1);
						});
						</text>
					}
				}
			});

			$("#linkToHome").attr("href", "@Url.Action(nameof(MeetingMainController.Index), nameof(MeetingMainController).GetControllerName())" + "/" + "@Model.ConferenceNickName")
			$("#linkToNewsList").attr("href", "@Url.Action(nameof(MeetingNewsListController.Index), nameof(MeetingNewsListController).GetControllerName())" + "/" + "@Model.NewsListId")

			@if (!string.IsNullOrEmpty(Model.PicForBackgroundPath)) {
				<text>
				background.setBackgroundAndOpacity($("#divImg"), "#ffffff", Number("@Model.OpacityOfPic"));
				$(".container").css({
					"background-image": "url(@Model.PicForBackgroundPath)",
					"background-size": "100% auto",
					"background-repeat": "repeat-y",
					"background-position": "top center",
					"background-attachment": "@Model.IsFollowBackground" == "True" ? "fixed" : "scroll",
				});
				</text>
			} else if (!string.IsNullOrEmpty(Model.ColorForBackground)) {
				<text>
				background.setBackgroundAndOpacity($(".container"), "@Model.ColorForBackground", 1 - Number("@Model.OpacityOfColor"));
				</text>
			}

			@if (!string.IsNullOrEmpty(Model.ColorForMenu)) {
				<text>
				background.setBackgroundAndOpacity($(".top"), "@Model.ColorForMenu", 1 - Number("@Model.OpacityOfMenu"));
				</text>
			} else {
				<text>
				background.setBackgroundAndOpacity($(".top"), "#4c4948", 1 - Number("@Model.OpacityOfMenu"));
				</text>
			}

			@if (!string.IsNullOrEmpty(Model.ColorForLeft)) {
				<text>
				background.setBackgroundAndOpacity($(".lbox"), "@Model.ColorForLeft", 1 - Number("@Model.OpacityOfLeft"));
				</text>
			} else {
				<text>
				background.setBackgroundAndOpacity($(".lbox"), "#ffffff", 1 - Number("@Model.OpacityOfLeft"));
				</text>
			}

			@if (!string.IsNullOrEmpty(Model.ColorForCenter)) {
				<text>
				background.setBackgroundAndOpacity($(".mbox"), "@Model.ColorForCenter", 1 - Number("@Model.OpacityOfCenter"));
				</text>
			} else {
				<text>
				background.setBackgroundAndOpacity($(".mbox"), "#ffffff", 1 - Number("@Model.OpacityOfCenter"));
				</text>
			}

			@if (!string.IsNullOrEmpty(Model.ColorForRight)) {
				<text>
				background.setBackgroundAndOpacity($(".rbox"), "@Model.ColorForRight", 1 - Number("@Model.OpacityOfRight"));
				</text>
			} else {
				<text>
				background.setBackgroundAndOpacity($(".rbox"), "#ffffff", 1 - Number("@Model.OpacityOfRight"));
				</text>
			}

			@if (!string.IsNullOrEmpty(Model.NewsBackgroundColor)) {
				<text>
				background.setBackgroundAndOpacity($(".con"), "@Model.NewsBackgroundColor", 1 - Number("@Model.NewsBackgroundOpacity"));
				</text>
			} else {
				<text>
				background.setBackgroundAndOpacity($(".con"), "#ffffff", 1 - Number("@Model.NewsBackgroundOpacity"));
				</text>
			}

			@if (!Model.IsShowShare) {
				<text>
				$(".msg").hide();
				</text>
			}
		});

		window.onresize = function () {
			background.setOnResize();
		}

		var abstract = "@Model.MainTextShared"
		abstract = abstract.replace(/&lt;.*?&gt;/ig, "").replace("&amp;ldquo;", "").replace("&amp;rdquo;", "")
		abstract = abstract.replace(/<.*?>/ig, "").replace("&ldquo;", "").replace("&rdquo;", "")
		var tit = "@Model.NewsTitle"
		var cname = " " + "@ConstValues.strTwoHyphen" + " " + "@Resources.SharedFrom" + " " + "@Model.ConferenceName"
		var len = 100 - tit.length - cname.length
		if (abstract.length > len) {
			abstract = abstract.substring(0,len-1) + "..."
		}

		bShare.addEntry({
			title: "@Model.NewsTitle",
			url: window.location.href,
			summary: abstract + " " + cname,
		});
	</script>
</head>
<body>
	@using (Html.BeginForm(nameof(UtilityController.SetCulture),
			nameof(UtilityController).GetControllerName(),
			FormMethod.Post, new { id = "frmCulture" }))
	{
		<input type="hidden" id="hidCulture" name="culture" />
	}
	<div style="position:relative;z-index:999;width:100%;">
		<!-- banner start -->
		<div class="banner">
			<img id="titleBanner" src="@Url.Action(nameof(UtilityController.ConferenceBannerImg), nameof(UtilityController).GetControllerName())?id=@Model.ConferenceId" />
			<div class="mar"><div class="time" id="m-time"></div></div>
		</div>
		<!-- banner end -->
		<div class="container">
			<div id="divImg">
				<!-- menu start -->
				<div class="top">
					<div class="main">
						<div class="nav_bar">
							<ul id="m-menu"></ul>
						</div>
					</div>
				</div>
				<!-- menu end -->
				<div class="mar">
					<!-- loction start -->
					<div class="loc">
						<div class="index"><p><img src="~/Images/tempImg/V9_fz.png" align="absmiddle" />&nbsp;&nbsp;@Resources.CurrentPosition：<a id="linkToHome">@Resources.HomePage</a>&nbsp;<span>&gt;</span>&nbsp;<a id="linkToNewsList">@Model.NewsListName</a>&nbsp;<span>&gt;</span>&nbsp;<a onclick="window.location.reload()">@Model.NewsTitle</a></p></div>
					</div>
					<!-- loction end -->
					<div class="tem05">
						<!-- middle start -->
						<div class="c">
							<!--div class="tit">NewsContent</div-->
							<div class="con" style="min-height:calc(100vh - 341px);">
								<div class="title">@Model.NewsTitle</div>
								<div class="msg">
									<div style="display:inline-block; font-size: 14px;">@Resources.NewsFrom@Model.Creator&nbsp;&nbsp;&nbsp;&nbsp;@Resources.PublishTime@Model.CreateDate</div>
									<div class="bshare-custom icon-medium" style="display:inline-block;margin-left:30px;">
										<div class="bsPromo bsPromo2"></div>
										<span style="font-size: 14px;">@Resources.ShareTo：</span>
										<a title="@Resources.ShareToWechat" class="bshare-weixin" href="javascript:void(0);"></a>
										<a title="@Resources.ShareToSinaWebo" class="bshare-sinaminiblog" href="javascript:void(0);"></a>
										<a title="@Resources.ShareToTwitter" class="bshare-twitter" href="javascript:void(0);"></a>
										<a title="@Resources.ShareToFacebook" class="bshare-facebook" href="javascript:void(0);"></a>
										<a title="@Resources.ShareToMore" class="bshare-more bshare-more-icon more-style-addthis"></a>
										<span class="BSHARE_COUNT bshare-share-count" style="float: none;">54.8K</span>
									</div>
									<div class="clear"></div>
								</div>
								<div align="center" class="art_img"></div>
								<div class="news">
									@Html.Raw(Model.MainText.Replace("\"", "'"))
								</div>
								<div style="clear:both;"></div>
							</div>
						</div>
						<!-- middle end -->
						<div class="clear"></div>
					</div>
				</div>
				<!-- footer start -->
				<div class="footer">
					<p>&copy;@Resources.CopyRightOfCisSystem</p>
					<p id="CopyRightId" style="margin-top:-70px">
						<a href="@Resources.CopyRightOfCisSystemLinkOne" target="_blank" style="color:#999">@Resources.CopyRightOfCisSystemOne &nbsp;&nbsp;</a>
						<a href="@Resources.CopyRightOfCisSystemLinkTwo" target="_blank" style="color:#999"><img src="~/Images/police.png" style="position:relative; top:4px;" />@Resources.CopyRightOfCisSystemTwo</a>
					</p>
				</div>
				<!-- footer end -->
			</div>
		</div>
	</div>
</body>
</html>